package com.reform.controller.admin;


import com.reform.pojo.admin.Admin;
import com.reform.res.Result;
import com.reform.service.IAdminService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiImplicitParam;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestMapping;

import org.springframework.web.bind.annotation.RestController;

import javax.servlet.http.HttpServletRequest;

/**
 * <p>
 *  前端控制器
 * </p>
 *
 * @author mortale
 * @since 2021-06-26
 */
@Api(tags = "AdminController")
@RestController
@RequestMapping("/admin")
public class AdminController {

    @Autowired
    IAdminService adminService;

    @ApiOperation(value = "转让超级管理员",notes = "转让超级管理员")
    @PostMapping("/transferSuperAuth")
    @ApiImplicitParam(name = "gh",value = "工号",paramType = "query",dataTypeClass = String.class,required = true)
    public Result transferSuperAuth(String gh, HttpServletRequest request){
        return adminService.transferSuperAuth(gh, request);
    }

    @ApiOperation(value = "设置部门管理员",notes = "设置部门管理员")
    @PostMapping("/setDepartmentAdmin")
    public Result setDepartmentAdmin(Admin admin){
        return adminService.setDepartmentAdmin(admin);
    }
}
